//
//  MultiTimerViewController.h
//  MultiTimer
//
//  Created by Jeffrey Palm on 6/3/09.
//  Copyright Jeffrey Palm 2009. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Clock.h"
#include <AudioToolbox/AudioToolbox.h>

@interface MultiTimerViewController : UIViewController<UIPickerViewDelegate> {
	IBOutlet UIDatePicker			*timePicker;
	IBOutlet UIToolbar				*toolbar;
	IBOutlet UIButton					*startButton;
	IBOutlet UIButton					*resetButton;
	IBOutlet UIButton					*setButton;
	IBOutlet UIButton					*unsetButton;
	IBOutlet UIBarButtonItem	*mainTimerButton;
	IBOutlet UIBarButtonItem	*timerButton1;
	IBOutlet UIBarButtonItem	*timerButton2;
	IBOutlet UIBarButtonItem	*timerButton3;
	IBOutlet UIBarButtonItem	*timerButton4;
	IBOutlet UIBarButtonItem	*timerButton5;
	IBOutlet UILabel					*timeLabel;
	
	int                        currentButtonIndex;
	
	Clock											*clock;
	BOOL											 ticking;
	
	NSTimer										*timer;
	
	CFURLRef			soundFileURLRef;
	SystemSoundID	soundFileObject;

@private UIBarButtonItem		*_timerButtons[NUM_TIMERS+1];
@private int								 _alarms[NUM_TIMERS+1]; // +1 for the main

	
}

@property (nonatomic,retain) UIDatePicker			*timePicker;
@property (nonatomic,retain) UIToolbar				*toolbar;
@property (nonatomic,retain) UIButton					*startButton;
@property (nonatomic,retain) UIButton					*resetButton;
@property (nonatomic,retain) UIButton					*setButton;
@property (nonatomic,retain) UIButton					*unsetButton;
@property (nonatomic,retain) UIBarButtonItem	*mainTimerButton;
@property (nonatomic,retain) UIBarButtonItem	*timerButton1;
@property (nonatomic,retain) UIBarButtonItem	*timerButton2;
@property (nonatomic,retain) UIBarButtonItem	*timerButton3;
@property (nonatomic,retain) UIBarButtonItem	*timerButton4;
@property (nonatomic,retain) UIBarButtonItem	*timerButton5;
@property (nonatomic,retain) UILabel					*timeLabel;

@property (nonatomic,retain) Clock						*clock;
@property (nonatomic       ) BOOL							 ticking;
@property (nonatomic       ) int							currentButtonIndex;

@property (readonly) UIBarButtonItem					**timerButtons;
@property (readonly) int											*alarms;

@property (nonatomic,retain) NSTimer					*timer;

@property (readwrite)	CFURLRef		soundFileURLRef;
@property (readonly)	SystemSoundID	soundFileObject;

-(IBAction)toggleTimer:(id)sender;
-(IBAction)resetTimer:(id)sender;
-(IBAction)setCurrentTimer:(id)sender;
-(IBAction)unsetCurrentTimer:(id)sender;

-(IBAction)useMainTimer:(id)sender;
-(IBAction)useTimer1:(id)sender;
-(IBAction)useTimer2:(id)sender;
-(IBAction)useTimer3:(id)sender;
-(IBAction)useTimer4:(id)sender;
-(IBAction)useTimer5:(id)sender;

@end

